home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / pluginy Firefox / 2410 / 2410.xpi / chrome / content / foxmarks-log.js < prev    next >
Text File  |  2010-01-28  |  798b  |  39 lines

  1. /* 
  2.  Copyright 2005-2007 Foxmarks Inc.
  3.  
  4.  foxmarks-log.js: provides logging support.
  5.  
  6.  */
  7.  
  8. var Xmarks;
  9. if(Xmarks === undefined){
  10.     Xmarks = {};
  11. }
  12.  
  13. (function() {
  14.  
  15. Xmarks.LogWrite = function(str) {
  16.     if (Xmarks.gSettings.enableLogging) {
  17.         Components.classes["@foxcloud.com/extensions/foxmarks;1"].
  18.             getService(Components.interfaces.nsIFoxmarksService).logWrite(str);
  19.     }
  20. }
  21.  
  22. Xmarks.LogTimer = function(str, startTime){
  23.     if(Xmarks.gSettings.getDebugOption("timing")){
  24.         var now = Date.now();
  25.         startTime = startTime || 0;
  26.         if(startTime){
  27.             Xmarks.LogWrite(str +
  28.                 " - time=" + (now - startTime ) + "ms");
  29.         } else {
  30.             Xmarks.LogWrite(str + " -  time=0");
  31.         }
  32.         return now;
  33.     }
  34.  
  35.     return 0;
  36. }
  37.  
  38. })();
  39.